package com.pearadmin.pro.modules.not.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.context.UserContext;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;
import com.pearadmin.pro.modules.not.domain.SysAnswer;
import com.pearadmin.pro.modules.not.domain.SysAnswerList;
import com.pearadmin.pro.modules.not.repository.SysAnswerRepository;
import com.pearadmin.pro.modules.not.service.SysAnswerService;
import com.pearadmin.pro.modules.sys.domain.SysUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class SysAnswerServiceImpl extends ServiceImpl<SysAnswerRepository, SysAnswer> implements SysAnswerService {

    @Resource
    private SysAnswerRepository SysAnswerRepository;

    @Resource // security 基本信息处理类
    private UserContext userContext;


    /**
     * 获取答疑区列表
     *
     * @return java.util.List<com.pearadmin.pro.modules.not.domain.SysAnswer>
     * @author ZhouXingYun
     * @date 2022/5/16 16:29
     */
    @Override
    public List<SysAnswer> getAnswerList() {
        List<SysAnswer> answerList = SysAnswerRepository.getAnswerList();
        return answerList;
    }

    /**
     * 查询所有评论
     *
     * @param dialogueId 会话ID
     * @return java.util.List<com.pearadmin.pro.modules.not.domain.SysAnswerList>
     * @author ZhouXingYun
     * @date 2022/5/17 15:44
     */
    @Override
    public List<SysAnswerList> getComment(String dialogueId) {
        List<SysAnswerList> answerList = SysAnswerRepository.getComment(dialogueId);
        return answerList;
    }

    /**
     * 新增评论
     *
     * @param sysAnswerList
     * @return boolean
     * @author ZhouXingYun
     * @date 2022/5/17 19:01
     */
    @Override
    public boolean savComment(SysAnswerList sysAnswerList) {
        return SysAnswerRepository.savComment(sysAnswerList);
    }
}
